/**
 * Copyright 2014  XCL-Charts
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * @Project XCL-Charts
 * @Description Android图表基类库
 * @author XiongChuanLiang<br></br>(xcl_168@aliyun.com)
 * @license http://www.apache.org/licenses/  Apache v2 License
 * @version 1.0
 */
package com.gitee.wsl.common.chart.listener.click

/**
 * @ClassName PositionRecord
 * @Description  位置记录信息基类
 * @author XiongChuanLiang<br></br>(xcl_168@aliyun.com)
 */
abstract class PositionRecord {
    //当前记录在数据源中行号
    //private static final String TAG = "PositionRecord";
    var dataID = -1
        protected set

    //当前记录所属数据集的行号
    var dataChildID = -1
        protected set

    //确认是否在范围内
    abstract fun compareRange(x: Float, y: Float): Boolean

    val recordID: Int
        get() {
            if (-1 == dataID && -1 == dataChildID) return -1
            var id = 0
            if (dataID > 0) id += dataChildID
            if (dataChildID > 0) id += dataChildID
            return id
        }

    //当前记录在数据源中行号
    protected fun saveDataID(num: Int) {
        dataID = num
    }

    //当前记录所属数据集的行号
    protected fun saveDataChildID(num: Int) {
        dataChildID = num
    } /*
	//分类轴的行号
	public int getCategoryID()
	{
		return mCategoryID;
	}
	*/
}